package com.yunji.common.enums.business;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.user.enums
 * @Title: TrendType
 *
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-09-03 14:33:23      V1.0        HuaAo       新建类
 */

public enum  TrendType {

    RECENT_SEVEN(1,"近七天"),
    THIS_MONTH(2,"本月"),
    LAST_MONTH(3,"上月"),
    RECENT_YEAR(4,"近半年");

    TrendType(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    private final Integer code;

    private final String text;

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code)
    {
        TrendType[] enums = TrendType.values();
        for (TrendType e: enums )
        {
            if (Objects.equals(e.code, code)) { return e.text; }
        }
        return null;
    }

}